home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
logbatch
/
greet.arc
/
GREET.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1989-07-26
|
4KB
|
117 lines
{This program was written for Borland's Turbo Pascal, version 5.5, to add
a little color to a Novell network's initial greeting of a user, since I
found the plain color greeting to be a bit boring. This program is put
into the public domain by the author, Ed Shoulta.
This program is designed to be used in conjunction with the WHOAMI command
on the network. You should pipe the output from WHOAMI into GREET as
follows:
WHOAMI | GREET }
Program greet (input,output);
{$E+} {emulate math coprocessor if not present}
uses {define Turbo Pascal Units used}
dos, crt;
const
good : array[1..4] of char = 'Good';
TimeOfDay : array[1..3] of string = ('morning ', 'afternoon ', 'evening ');
var
whoiam, TOD : string; {input from WHOAMI and Time Of Day}
who : array [1..47] of char; {login name}
I, J: integer; {counters}
h, m, s, hund : word; {variables for call to get system time}
begin {program}
who := ' '; {initialize}
Assign(Input,'');
Reset(Input); {allow for redirected input with CRT unit}
readln (whoiam); {read in variable from NOVELL}
I := 14; {initialize counters}
J := 1;
repeat {loop to get login name into variable who}
begin
if whoiam[I] <> ' ' then {if not blank, copy letter}
begin {into variable who}
who[I - 13] := whoiam[I];
I := I + 1;
J := J +1 {increment counters}
end
else
I := 61 {else force exit}
end
until I = 61;
for I := 1 to 12 do {display 12 blank lines}
writeln;
write (' '); {display 9 spaces}
for I := 1 to ((47 - J) DIV 2) do
write (' '); {to center greeting on screen}
TextBackground(Black);
I := 9;
Repeat
begin
Textcolor(I);
I := I + 1;
write (good[I - 9])
end
until I = 13;
write (' ');
GetTime(h,m,s,hund); {Get system time}
if h < 12 then {If earlier than noon}
TOD := TimeOfDay[1]
else if (h >= 12) and (h < 17) then {If later than noon, earlier than 5 pm}
TOD := TimeOfDay[2]
else {If later than 5 pm}
TOD := TimeOfDay[3];
J := 1; {Initialize counter for loop}
repeat {Begin loop for colorization of Time Of Day}
begin
TextColor(I);
write (TOD[J]);
J := J + 1;
if I < 15 then {test code number}
I := I + 1 {increment color}
else
I := 9 {set color back to bright blue}
end
until TOD[J] = ' ';
write (' ');
J := 1; {Initialize counter for loop}
repeat {Begin loop for colorization of login name}
begin
TextColor(I);
write (who[J]);
J := J + 1;
if I < 15 then {test code number}
I := I + 1 {increment color}
else
I := 9 {set color back to bright blue}
end
until who[J] = ' ';
TextColor(I);
write ('!'); {display "!" with next color}
NormVideo; {Reset video attributes}
for I := 1 to 12 do {display 12 more blank lines}
writeln;
Delay(2000); {pause 2000 milliseconds}
end.{program} {That's All Folks!}